<?php
/**
 * Created by PhpStorm.
 * User: jksen
 * Date: 2018/1/19
 * Time: 下午12:17
 */

namespace app\common\Model;

use think\Db;

class FuncClass extends BaseModel
{
    public static $tab_name = 'func_class';

    // 设置返回数据集的对象名
    protected $resultSetType = 'collection';

    //是否启用，1启用，0:不启用
    const STATUS_NORMAL = 1;
    const STATUS_FORBID = 0;
    public $_status = [
        1 => '有效',
        0 => '禁用',
    ];

    //删除:0为未删除,1为删除
    const IS_DEL_TRUE = 1;
    const IS_DEL_FALSE = 0;

    //可排序字段
    public $sort_field = array(
        'func_name' ,
        'sort' ,
        'status' ,
        'create_time'
    );

    /**
     * 获取所有的捎货业务表
     */
    public static function getAllFunc($where = null, $field = '')
    {
        return Db::name(self::$tab_name)->where($where)->field($field)->select();
    }
}